<?php
use yii\helpers\Html;
use common\components\helpers\Fun;
use doumiaoduo\layer\LayerConfirmWidget;
use doumiaoduo\layer\LayerIframeWidget;
use common\components\extenders\MenuManage;
use common\components\widgets\Datetimepicker;
Datetimepicker::widget(['format'=>'Y-m-d',]);
LayerConfirmWidget::widget();
LayerIframeWidget::widget();
?>
<div class="yx-praise-list-box yx-praise-box yx-radius2 zx-min-height" id="toolbar" data-shelve_url="">
        <div class="yx-member-info">
            <table class="yx-member-box yx-member-box1" style="width: 100%">
                <tr>
                    <td bgcolor="#f8f8f8">机构</td>
                    <td><?=$model->mechanic->name?></td>
                    <td bgcolor="#f8f8f8">结算金额</td>
                    <td><?=$model->commission_money?></td>
                    <td bgcolor="#f8f8f8">是否付款</td>
                    <td><?php
                         switch ($model->status){
                             case 0:
                                 echo '未付款';
                                 break;
                             case 1:
                                 echo '已付款';
                                 break;
                         }
                        ?></td>
                    <td bgcolor="#f8f8f8">结算人</td>
                    <td><?=$model->operator?></td>
                </tr>
        </table>
    </div>
        <div class="yx-member-info">
            <table class="yx-member-box yx-member-box1" style="width: 100%">
                <tr>
                    <td bgcolor="#f8f8f8">付款人</td>
                    <td><?=$model->paymant_operator?></td>
                    <td bgcolor="#f8f8f8">付款方式</td>
                    <td><?=$model->payment_method?></td>
                    <td bgcolor="#f8f8f8">付款时间</td>
                    <td><?=date('Y-m-d H:i:s',$model->payment_time)?></td>
                </tr>
            </table>
        </div>
    <div class="docs-main zx-mg">
        <table id="tablesaw" class="tablesaw table yx-table1 yx-table5 table-striped with-check"  >
            <thead>
            <tr class="yx-bgd2f6ec">
                <th><?=\Yii::t('zhtfrontend','课程');?></th>
                <th><?=\Yii::t('zhtfrontend','补贴金额');?></th>
                <th><?=\Yii::t('zhtfrontend','课次');?></th>
                <th><?=\Yii::t('zhtfrontend','上课日期');?></th>
                <th><?=\Yii::t('zhtfrontend','上课人数');?></th>
                <th><?=\Yii::t('zhtfrontend','结算时间');?></th>
            </tr>
            </thead>
            <?php if($data):?>
                <?php foreach($data as $item):?>
                    <tr data-id="<?=$item['id']?>">
                        <td><?=$item['goods_name']?></td>
                        <td><?=$item['amount']?></td>
                        <td><?=$item['lesson']?></td>
                        <td><?=$item['class_date']?></td>
                        <td><?=$item['people_number']?></td>
                        <td><?=$item['settlement_time']?></td>
                    </tr>
                <?php endforeach?>
            <?php endif?>
        </table>
            <?php if($VoucherList != null) {?>
            <ul>
                <?php foreach ($VoucherList as $voucher) { ?>
                <li style="float: left; width: 300px; margin-right: 5px; margin-bottom: 5px ">
                    <img src="<?=$voucher->voucher_url?>" width="300px" >
                </li>
                <?php } ?>
            </ul>
           <?php } ?>
        <div style="clear: both"></div>
        <?php if($model->status == 0) { ?>
            <?=(new MenuManage(MenuManage::TOP_MENU))->detailsMenu('mechanicsettlement','payment',false,['rel'=>'dialog-show-iframe','class' => 'btn yx-classmagage-about yx-bg89c997 yx-width78 yx-mr5 yx-radius2','data'=>['id'=>\Yii::$app->request->get('id'),'name'=>'确认付款']]);?>
        <?php }else{ ?>
            <?=(new MenuManage(MenuManage::TOP_MENU))->detailsMenu('mechanicsettlement','voucher',false,['rel'=>'dialog-show-iframe','class' => 'btn yx-classmagage-about yx-bg89c997 yx-width78 yx-mr5 yx-radius2','data'=>['id'=>\Yii::$app->request->get('id'),'name'=>'添加凭证']]);?>
        <?php } ?>
        </div>

</div>



